{% extends "layout.html" %}
{% block body %}
<div class="page-header">
  <ul class="breadcrumb">
    <li><a href="/">Home</a></li>
    <li class="active">Account Page</li>
  </ul>
  <h3 id="containers">Welcome, {{ g.user.email }}</sub></h3>
</div>
      
<div class="account">
  <div class="col-lg-3">
    {% include 'account_navbar.html' %}
  </div>

  <div class="col-lg-9">
    <div class="panel panel-default account-pannel">
      <div class="panel-heading">
        <h3 class="panel-title"><span class="glyphicon glyphicon-th-large" aria-hidden="true"></span>
         Read History
        </h3>
      </div>
      <div class="panel-body">
        {% if data %}
        <table class="table table-hover">
          {% for item in data %}
          <tr>
            <td>
              <a href="{{ url_for('book', id=item.book_id) }}" target="_blank"><span class="glyphicon glyphicon-knight" aria-hidden="true"></span> 
              {% if item.en_title %}
                {{ item.en_title }}
              {% else %}
                {{ item.title }}
              {% endif %}
              </a>
            </td>
            <td>
              {% if item.en_name %}
              <a href="{{ url_for('book_chapter', book_id=item.book_id, chapter_id=item.chapter_id) }}" target="_blank">{{ item.en_name }}</a>
              {% endif %}
            </td>
            <td align="right">{{ item.update_time|strftime }}</td>
          </tr>
          {% endfor %}
        </table>
        {% else %}
        <p><em>Unbelievable.  No contents here so far</em></p>
        {% endif %}
      </div>
    </div>
  </div>
</div>
{% endblock %}

{% block title %}Read History - JiangHu Novel{% endblock %}